<!--<?php
if (!defined('AJAX')){include_once PrintEot('left');}
if($action == 'detail' && defined('AJAX')){
print <<<EOT
-->
<div class="popoutContent">
   	<h2 class="h1"><a class="del_img fr" href="javascript:;" onclick="closep();">关闭</a>团购用户详细信息</h2>
  	<div style="height: 273px; overflow-y: auto;">
      	<div class="admin_table mb10">
<!--
EOT;
if($userdetail){print <<<EOT
-->
          <table cellspacing="0" cellpadding="0" width="100%">
              <tbody>
              <tr class="tr1 vt"><td class="td1">姓名</td><td class="td2">$userdetail[username]</td></tr>
              <tr class="tr1 vt"><td class="td1">性别</td><td class="td2">$userdetail[gender]</td></tr>
              <tr class="tr1 vt"><td class="td1">联系电话</td><td class="td2">$userdetail[phone]</td></tr>
              <tr class="tr1 vt"><td class="td1">电子邮件</td><td class="td2">$userdetail[email]</td></tr>
              <tr class="tr1 vt"><td class="td1">购房预算</td><td class="td2">{$house_field[budget][$userdetail[budget]][value]}</td></tr>
              <tr class="tr1 vt"><td class="td1">户型面积</td><td class="td2">{$house_field[acreage][$userdetail[area]][value]}</td></tr>
              <tr class="tr1 vt"><td class="td1">团购时间</td><td class="td2">$userdetail[ctime]</td></tr>
              <tr class="tr1 vt"><td class="td1">留言</td><td class="td2"  style="width:300px">$userdetail[remark]</td></tr>
          </tbody></table>
<!--
EOT;
}print <<<EOT
-->
        </div>
    </div>
</div>
<!--
EOT;
}else{
$_stats = $_list = '';
if($action == 'stats'){
	$_stats = 'class="current"';
}else{
	$_list = 'class="current"';
}
print <<<EOT
-->
<script language="JavaScript" src="js/global.js"></script>
<script language="JavaScript" src="js/pw_ajax.js"></script>
<script language="JavaScript" src="js/date.js"></script>
<div class="nav3 mb10">
    <ul class="cc">
<!--
EOT;
if(!$hid){
print <<<EOT
-->
		<li $_list><a hidefocus="true" href="$basename">团购列表</a></li>
<!--
EOT;
}print <<<EOT
-->
        <li $_stats><a hidefocus="true" href="$basename&action=stats&hid=$hid">团购统计</a></li>
<!--
EOT;
if($hid){
print <<<EOT
-->
		<li $_list><a hidefocus="true" href="javascript:;" onclick="parent.PW.Dialog({id:'house_groupbuy',url:'$admin_file?adminjob=mode&admintype=house_groupbuy',name:'楼盘团购管理'});return false;">团购列表</a></li>
		<li><a hidefocus="true" href="admin.php?adminjob=mode&admintype=house_info&action=edit&hid=$hid">返回楼盘管理</a></li>
<!--
EOT;
}print <<<EOT
-->
    </ul>
</div>
<!--
EOT;
if($action != 'sendmsg' && !($action == 'stats' && $hid)){
print <<<EOT
-->
<div class="mb10" id="legend"><h3 class="h1">搜索条件</h3></div>
<form action="$basename&" method="post">
<input type="hidden" name="action" value="search"/>
<input type="hidden" name="hid" value="$hid" />
<div class="search p_lr_10 mb10">
	楼盘名称:<input type="text" value="$hname" name="hname" class="input input_wc" $_readonly/>
	性别:<select name="gender"><option value="all"></option><option value="2" $gender_M>男</option><option value="1" $gender_W>女</option></select>
	购房预算:{$budgetHtml} 户型面积:{$areaHtml}
	是否注册用户:<select name="register"><option value="all"></option><option value="ne" $register_Y>是</option><option value="eq" $register_N>否</option></select>
	提交时间:<input id="stime" type="text" value="$stime" name="stime" class="input input_wc" onclick="ShowCalendar(this.id,1)"/>-<input id="etime" type="text" value="$etime" name="etime" class="input input_wc" onclick="ShowCalendar(this.id,1)"/>
	<span class="btn2"><span><button onfocus="blur();" type="button" onclick="submitStats(this.form,'search')">搜 索</button></span></span>
	<span class="bt2"><span><button onfocus="blur();" type="button" onclick="submitStats(this.form,'stats')">统 计</button></span></span>
</div>
</form>
<script type="text/javascript">
function submitStats(obj,type){
	obj.action.value = type;
	obj.submit();
}
</script>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if(empty($action) || $action == 'search'){
print <<<EOT
-->
<h3 class="h1"><span class="fl">团购列表</span><span class="fr">[共{$totalCount}条结果]</span></h3>
<div class="admin_table mb10">
<form action="$basename&" method="post" name="FORM">
	<input type="hidden" name="allIds" value="$allIds"/>
	<table cellspacing="0" cellpadding="0" width="100%">
   		<tbody><tr class="tr2">
        	<td width="40" class="tac"><span class="cp" onclick="CheckAll(document.FORM)">选择</span></td>
            <td>姓名</td>
            <td>性别</td>
            <td>联系电话</td>
            <td>电子邮件</td>
            <td>购房预算</td>
            <td>户型面积</td>
            <td>楼盘名称</td>
            <td>用户名</td>
            <td>操作</td>
        </tr>
<!--
EOT;
if(count($groupbys['contents'])){
foreach($groupbys['contents'] as $key => $value){
print <<<EOT
-->
        <tr class="tr1 vt">
        	<td class="td2"><input type="checkbox" value="$value[id]" name="id[]"/></td>
            <td class="td2">$value[username]</td>
            <td class="td2">$value[gender]</td>
            <td class="td2">$value[phone]</td>
            <td class="td2">$value[email]</td>
            <td class="td2">{$house_field['budget'][$value['budget']][value]}</td>
            <td class="td2">{$house_field['acreage'][$value['area']][value]}</td>
            <td class="td2"><a href="{$houseBaseUrl}q=info&hid=$value[hid]" target="_blank">$value[hname]</a></td>
            <td class="td2">
<!--
EOT;
if($value[uid] != 0){
print <<<EOT
-->
			<a href="mode.php?m=o&q=user&username=$value[author]" target="_blank">
<!--
EOT;
}print <<<EOT
-->
			 {$value[author]}
<!--
EOT;
if($value[uid] != 0){
print <<<EOT
-->
			</a>
<!--
EOT;
}print <<<EOT
-->

            </td>
            <td class="td2">
            	<a id="showdetail_$value[id]" class="mr20" href="javascript:;" onclick="sendmsg('$basename&action=detail&id=$value[id]','',this.id)">[详细]</a>
            	<a class="mr20" href="$basename&action=del&id=$value[id]" onclick="return confirm('确定要删除吗？');">[删除]</a>
            </td>
        </tr>
<!--
EOT;
}
}else{
print <<<EOT
-->
<tr><td class="p10" colspan="9"><div class="admin_tips">啊哦，没有你要的信息！</div></td></tr>
<!--
EOT;
}
print <<<EOT
-->
    </tbody></table>
</div>
<div class="mb10 cc">$groupbys[pages]</div>
<div class="mb10 tac">
  <span>操作</span>
  <label><input type="radio" value="sendmsg" name="action" checked="checked"/> 群发消息</label>&nbsp;&nbsp;
  <label><input type="radio" value="del" name="action"/> 删除</label>
</div>
<div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(this.form)" onfocus="blur();">全 选</button></span></span>
	<span class="btn"><span><button onclick="return confirm('确认要进行此操作吗？');" type="submit" onfocus="blur();">提 交</button></span></span>
</div>
</form>
<!--
EOT;
}elseif($action == 'stats'){print <<<EOT
-->
<h3 class="h1">楼盘团购统计</h3>
<div class="admin_table mb10">
	<table cellspacing="0" cellpadding="0" width="100%">
    	<tbody>
    		<tr class="tr1 vt">
	        	<td class="td1">搜索结果</td>
	            <td class="td2">
	            	<a href="$searchurl" class="s1">{$count}</a>人
<!--
EOT;
if($hid){
print <<<EOT
-->
					<form action="$basename" method="post">
					<input type="hidden" value="editStatsCount" name="action"/>
					<input type="hidden" value="$hid" name="hid"/>
					&nbsp;&nbsp;&nbsp;&nbsp;修改显示人数 
					<input type="text" value="$houseinfo[groupbuynum]" name="statsCount" class="input input_wc"/>
					<span class="bt2"><span><button type="submit" onfocus="blur();">提 交</button></span></span>
					</form>
<!--
EOT;
}print <<<EOT
-->	            	
	            </td>
        	</tr>
			<tr class="tr1 vt">
	        	<td class="td1">性别</td>
	            <td class="td2">
<!--
EOT;
foreach($statsinfo['gender'] as $key => $value){
$_searchurl = $key == '女'? $searchurl.'&gender=1' : $searchurl.'&gender=2';
print <<<EOT
-->
				 $key <a href="$_searchurl" class="s1">{$value}</a>人 &nbsp;&nbsp;
<!--
EOT;
}print <<<EOT
-->
	            </td>
	        </tr>
        	<tr class="tr1 vt">
	        	<td class="td1">其中购房预算</td>
	            <td class="td2">
<!--
EOT;
foreach($statsinfo['budget'] as $key => $value){
$_searchurl = $searchurl.'&budget='.$key;
$sub = $house_field[budget][$key][value] ? $house_field[budget][$key][value] : '未选择购房预算';
print <<<EOT
-->
				{$sub} <a href="$_searchurl" class="s1">{$value}</a>人 &nbsp;&nbsp;
<!--
EOT;
}print <<<EOT
-->
	        	</td>
        	</tr>
        	<tr class="tr1 vt">
	        	<td class="td1">其中购房面积</td>
	            <td class="td2">
<!--
EOT;
foreach($statsinfo['area'] as $key => $value){
$_searchurl = $searchurl.'&area='.$key;
$sub = $house_field[acreage][$key][value] ? $house_field[acreage][$key][value] : '未选择购房面积';
print <<<EOT
-->
				{$sub} <a href="$_searchurl" class="s1">{$value}</a>人 &nbsp;&nbsp;
<!--
EOT;
}print <<<EOT
-->	            
	            </td>
        	</tr>
		</tbody>
	</table>
</div>
<!--
EOT;
}elseif($action == 'sendmsg'){
print <<<EOT
-->
<h3 class="h1">短消息群发</h3>
<form name='FORM' action="$basename" method="post">
<input type="hidden" name="action" value="sendmsg" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="uids" value="$uids" />
<script language="JavaScript" src="js/wind_editor.js"></script>
<div class="admin_table mb10">
<table cellspacing="0" cellpadding="0" width="100%">
	<tbody><tr class="tr1 vt">
		<td width="15%" class="td1">主题</td>
		<td width="85%" class="td2"><input type="text" class="input" name="subject" size="60" /></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">内容</td>
		<td class="td2">
<!--
EOT;
require_once(R_P.'template/wind/editor.htm');
print <<<EOT
-->
		</td>
	</tr>
	</tbody>
</table>
<br />
<div class="mb10 tac">
	<span class="btn"><span><button onfocus="blur();" type="submit">提 交</button></span></span>
</div>
</div>
</form>
<!--
EOT;
}}
if (!defined('AJAX')){include_once PrintEot('adminbottom');}
?>-->